package account.service.impl;

import account.dao.AccountDao;
import account.entity.AccountVO;
import account.service.AccountService;
import generic.page.Page;
import generic.page.Pages;


public class AccountServiceImpl implements AccountService{


    private AccountDao accountDao;

    public AccountDao getAccountDao() {
        return accountDao;
    }

    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }


    public account.entity.AccountVO findAccountVoById(Integer id){
        return (account.entity.AccountVO)this.accountDao.findAccountVoById(id);
    }


    public void deleteAccountById(Integer id) {

        this.accountDao.deleteAccountById(id);
    }

    @Override
    public AccountVO updateAccount(account.entity.AccountVO accountVO) {
        return  this.accountDao.updateAccount(accountVO);
    }


    public account.entity.AccountVO findByLoginAccount(String loginAccount) {

        return this.accountDao.findByLoginAccount(loginAccount);
    }

    @Override
    public Pages queryForPage(Pages pages) {
        if(pages==null){
            pages=new Pages();
        }
        return this.accountDao.queryForPage(pages);
    }


    @Override
    public AccountVO findAccount(AccountVO accountVO) {
        return accountDao.findAccount(accountVO);
    }

    @Override
    public Page queryPage(Integer pageSize, Integer currentPage) {
        if(currentPage == null){
            currentPage =  1 ;
        }
        return this.accountDao.queryPage(pageSize,currentPage);
    }


}
